#ifndef __MEMORYDEFS_H__
#define __MEMORYDEFS_H__

#include "global_defs.h"

#include <new.h>

#ifndef GS_LIB
	#ifndef GS_SYSTEM_MODULE
		#define MEM_USAGE_API DLL_IMPORT
	#else
		#define MEM_USAGE_API DLL_EXPORT
	#endif
#else
	#define MEM_USAGE_API
#endif

struct memoryStats_t
{
	int num;
	int minSize;
	int maxSize;
	int totalSize;
};

extern "C"
{
	MEM_USAGE_API void Mem_Init();
	MEM_USAGE_API void Mem_Shutdown();

	MEM_USAGE_API void Mem_ClearFrameStats();
	MEM_USAGE_API void Mem_GetFrameStats(memoryStats_t &allocs, memoryStats_t &frees);
	MEM_USAGE_API void Mem_GetStats(memoryStats_t &stats);

	MEM_USAGE_API void* Mem_Alloc(const int size);
	MEM_USAGE_API void* Mem_ClearedAlloc(const int size);
	MEM_USAGE_API int Mem_Free(void *ptr);
	MEM_USAGE_API char* Mem_CopyString(const char *in);
	MEM_USAGE_API void* Mem_Alloc16(const int size);
	MEM_USAGE_API void Mem_Free16(void *ptr);
}

#endif // __MEMORYDEFS_H__